Skip to content

feat(studio): a dataset is a data type; datasets and positions are always listed in the menu - #37599

Draft
objectstack-fleet[bot] wants to merge 3 commits into
mainfrom
claude/project-thread-80m7oi
Draft

objectstack-fleet[bot] wants to merge 3 commits into
mainfrom
claude/project-thread-80m7oi

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

repo:objectstack#5 · os-bill · session_01Utp6CbgELiNQU6e7me1RQy

Fixes #37564

Clause-②: no
Metadata-protocol: none
Container & model: M, mode:thread, model: CONTRACT_REVIEW_TIER (dispatch-gates --tier: MANDATORY docs/adr/**; served at tier, read from the thread's session record), effort: xhigh (reason: ADR-0084 revision plus a spec registry value, standing ADR-revision order)

维护者速读

  • 用户能看到什么变化:在 Studio 左侧菜单里,「数据集」从「界面」组的「高级」折叠里挪到「数据」组,紧跟在「对象」后面;「岗位」从「高级」折叠里挪到「访问」组,紧跟在「权限集」后面。两项始终显示,软件包里一个都没有也显示。
  • 为什么做:属于「Studio 是开发软件包的入口」这一轮菜单整理,落实你 11 月 26 日对架构记录 ADR-0084 的裁定:数据集是图表和 AI 问数共用的语义层,归数据;数据集和岗位都是常用项。记录里的类型归组表同步改成和菜单一致。
  • 出错会怎样:只影响这两类在菜单、类型目录里的位置和分组徽标,数据集本身的读写、图表、问数都不受影响,可以直接撤回。有一个对外可见的值变了:类型列表接口里数据集的归组由「界面」变成「数据」,按归组挑数据集的外部代码要跟着改。
  • 要你做什么:批准并合入(改了架构记录,属于受管文件,需要 os-zhuang 和 hotlong 批准)。没有需要你裁定的问题。

What changes

Nine files, +192 / −34 against merge base 41164656. This PR carries out ADR-0084's Amendment (2026-11-26), "Placements, and what moves to Setup" for two rows, dataset and position, and decides nothing.

Where What changes
packages/spec/src/kernel/metadata-plugin.zod.ts One value: the dataset row of DEFAULT_METADATA_TYPE_REGISTRY reads domain: 'data'; it was 'ui'. A comment above the row says why. The row keeps its place in the block and its loadOrder (55).
ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.ts dataset and position move into the common rows, by name: dataset directly after object, position directly after permission. Each row carries its reason in a comment: a dataset's schema requires one object, and a position is one slot per name in the environment (ADR-0150 D7), so the rule's tests alone would sort each of them advanced. Twelve common rows, twenty advanced.
docs/adr/0084-application-builder-information-architecture.md The type-to-group table: dataset is row 2 of 数据 Data, tier 常用, and the five data types behind it are each one place later; its 界面 UI row is gone; position keeps its place and its tier reads 常用. One note under the table and one mark on the amendment's "not redrawn today" paragraph say the two rows are rewritten and that datasource and form still wait for their own changes. Nit N8 of the contract record on PR #37470: the 2026-11-24 top note's 2026-11-26 mark now links #amendment-2026-11-26-position. Still 32 rows of the pinned shape, in one table.
Four test files under ui/packages/app-shell/src/views/studio-design/ and packages/spec/src/kernel/metadata-plugin.test.ts The pins, below.
.changeset/37564-dataset-data-domain-common-tier.md @objectstack/spec patch, @object-ui/app-shell patch.

What follows from the registry value, with no edit. The menu, the type directory and the type page's group badge read the served domain, so all three show datasets under 数据 Data. studioMenuModel.ts and StudioMenu.tsx are not touched: the model reads the placement list and needs no special case.

A served value changes. GET /api/v1/meta/types answers domain: "data" for the dataset entry, and the listing is ordered by domain and then by type, so the entry now sits first among the data types. Read on a live showcase backend built from this branch: data:dataset data:field data:hook data:mapping data:object …. Code that finds the entry by type sees no difference. The changeset says this in the release note.

Why Clause-②: no and Metadata-protocol: none. No accepted set widens or narrows: the domain enum keeps its six values, no author writes the registry, and a *.dataset.ts item validates and loads as it did. No export, key or type is added, and the constant's declared type is the same. pnpm --filter @objectstack/spec check:generated reads "All 14 generated artifacts are up to date", so neither the API surface nor the authorable surface moved.

Not touched, as the card says. The datasource row, and form (ADR-0159): form is not registered at this base, so it has no row. The typescript-serializer.ts entry that maps dataset to ['Dataset', 'ui'] is the spec subpath the schema is imported from, not the domain; the schema still lives in ui/dataset.zod.ts.

Read first, by risk:

  1. packages/spec/src/kernel/metadata-plugin.zod.ts, the one-value hunk on the dataset row: it changes a served value.
  2. docs/adr/0084-application-builder-information-architecture.md, the table hunk: governed text, and the order of the 数据 Data rows is what the pin test compares to the placement list.
  3. ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.ts, the two rows that move into the common block.

Two-minute verification: after pnpm --filter @objectstack/spec build, run pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/studioMenuPlacement.test.ts and expect Tests 17 passed (17). It reads the registry, the placement list and ADR-0084's table, and fails if any two of the three disagree.

Tests

  • packages/spec/src/kernel/metadata-plugin.test.ts: a new case pins dataset under data, dashboard and report under ui, and the six-value domain set. 41 of 41.
  • studioMenuPlacement.test.ts: the literal lists (twelve common, twenty advanced), a case for the two placements by name, and a new block that reads the three groups this change touches as ADR-0084 lists them. The existing block that compares the list with the ADR's Order and Tier columns, row by row, passes against the rewritten rows. 17 of 17.
  • studioMenuModel.test.ts and StudioMenu.test.tsx: the served fixture gains dataset under data; the common tier, the always-listed set and the fold are pinned with both types above the fold; a new block in StudioMenu.test.tsx asserts that 数据 draws object then dataset, 访问 draws permission then position, neither is inside the fold, and each links to its type page on an empty package, with a control (hook stays in the fold).
  • StudioPaletteGroups.surfaceScope-36900.test.tsx: the command palette draws the menu's entries, so position now follows permission there and its list is read. Two expectations, test only.
  • The four UI files together: 92 of 92.

Reverse verification, each mutation made with scripts/ablation-replace.mjs on a committed tree and restored to HEAD (blob equal to HEAD, git diff HEAD empty after each):

Mutation Reading
Registry: dataset back to domain: 'ui', spec rebuilt, dist read back as ui spec pin: 1 failed, 40 passed. studioMenuPlacement.test.ts: 5 failed, 12 passed (the ADR's group against the served domain, the order inside the group, and the new group block).
Placement list: position back to advanced 14 failed, 78 passed, in all four UI files.
Placement list: dataset back to advanced 12 failed, 80 passed, in three UI files. The palette file stays green: its fixture serves no dataset.

After the registry leg the package was rebuilt from the restored source and scripts/ablation-dist-preflight.mjs … --absent read the marker gone from all 614 built files; both pins passed again (41 of 41, 17 of 17).

Acceptance notes

Verification

  • Gate list derived on c2e09545: node scripts/pm/dispatch-gates.mjs --commands prints 98 commands (9 paths against merge base 41164656); the same 98 as on the commit before it.
  • All 98 exited 0, each exit code captured before any pipe. --ran reconciliation: 98 derived famil(ies) accounted for — 98 run, 0 NOT-MEASURED.
  • Which tree each ran on: the first pass started on 947362fd; the last commit (c2e09545, the palette test, +4 / −1) landed part-way through it. The 28 script gates were run again on c2e09545, all 0, and the remaining 70 are being run again on c2e09545; the report on the card carries that reading.
  • Two first-pass reds were the container, not the diff, and each passed when run again alone: check-plugin-teardown-shape.mjs --self-test needs a pinned fixture commit that a shallow clone lacks (fetched, then 48 cases pass); pnpm --dir ui exec vitest run scripts/ was killed by the container's memory limit while another test run shared the box (alone: 172 files passed, 2 skipped).
  • Affected UI tests under the verify lock: every test file that reads the placement list or the directory grouping, 82 files, 664 tests. 662 passed on the first run; the 2 that failed were the palette expectations above, and that file is 11 of 11 after the edit.
  • pnpm --filter @objectstack/spec run typecheck, pnpm --filter @object-ui/app-shell run type-check, eslint on the seven changed source and test files, and pnpm --dir ui run check:new-line-citations: each exit 0 on c2e09545.
  • Full workspace build before the UI runs: 123 of 123 tasks successful.
  • overlap-check.mjs on c2e09545: merges cleanly with origin/main 0f6a1e51; conflicts with PR feat(studio): 概览 package overview page — Info and Pending tabs, ⋯ menu in its header #37546's head in StudioMenu.test.tsx (above).
  • dispatch-gates --tier: docs/adr/** is the mandatory contract tier; changed lines 226 against the human-merge threshold 3000: under.
  • check-prior-rulings --paths on the ADR, the registry file and the placement list: the 2026-11-24, 2026-11-25 and 2026-11-26 amendments of ADR-0084 are the rulings in force; this PR changes no decision of any of them.
  • Three commits. No message names a card.
  • CI-owned families (type-check lanes, artifact rosters, test:repo, the dogfood battery, the always-runs tail) are this PR's check-runs.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Utp6CbgELiNQU6e7me1RQy

…osition

The registry row for dataset moves from domain ui to data, the menu's
placement list places dataset directly after object and position directly
after permission in the common tier, and ADR-0084's type-to-group rows are
rewritten in the same change, as its 2026-11-26 amendment asks.

Claude-Session: https://claude.ai/code/session_01Utp6CbgELiNQU6e7me1RQy
Co-authored-by: Claude <noreply@anthropic.com>
The command palette draws the left menu's entries. With position placed
in the common tier it is listed on a package that holds none, directly
after permission, and its list is read when the palette opens.

Claude-Session: https://claude.ai/code/session_01Utp6CbgELiNQU6e7me1RQy
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/spec, touching 1 documentable anchor(s).

3 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/concepts/metadata-lifecycle.mdx (via DEFAULT_METADATA_TYPE_REGISTRY (symbol, a top-level const object))
  • content/docs/plugins/adding-a-metadata-type.mdx (via DEFAULT_METADATA_TYPE_REGISTRY (symbol, a top-level const object))
  • content/docs/protocol/objectui/concept.mdx (via DEFAULT_METADATA_TYPE_REGISTRY (symbol, a top-level const object))
What this run could not see

Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 0f6a1e518f3c4639b03f86a8c07d9d08d91bddb6 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 0de8ec66935fd6446b02257104e3dfe32611c430 — the merge of head c2e09545974c9dfc737e2f477258ebeea777bd8c into base 0f6a1e518f3c4639b03f86a8c07d9d08d91bddb6, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 0de8ec66935fd6446b02257104e3dfe32611c430 && git checkout 0de8ec66935fd6446b02257104e3dfe32611c430
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 0f6a1e518f3c4639b03f86a8c07d9d08d91bddb6 c2e09545974c9dfc737e2f477258ebeea777bd8c && git checkout -B drift-repro 0f6a1e518f3c4639b03f86a8c07d9d08d91bddb6 && git merge --no-ff c2e09545974c9dfc737e2f477258ebeea777bd8c

node scripts/docs-audit/affected-docs.mjs --json 0f6a1e518f3c4639b03f86a8c07d9d08d91bddb6

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 0f6a1e518f3c4639b03f86a8c07d9d08d91bddb6 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants